package org.fang.service;

import org.fang.common.PlatformResult;
import org.fang.pojo.CloudUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author forsake
 * @Description  通过feign方式调用实现服务的降级
 * @Date 15:46 2022/3/15
 **/
@Component
@FeignClient(value = "CLOUD-PROVIDER",fallbackFactory = UserFallbackFactory.class)
public interface UserClientService {
    /**
     *
     * @param id
     * @return
     */
    @RequestMapping("/cloudUser/queryById/{id}")
    PlatformResult queryById(@PathVariable("id") Integer id);

    /**
     *
     * @param user
     * @return
     */
    @RequestMapping("/cloudUser/add")
    PlatformResult add(@RequestBody CloudUser user);
}
